package com.example.result;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private Integer code;
    private String message;
    private Object data;

    public static Result success(Integer code, String message) {
        return new Result(code, message, null);
    }

    public static Result success(Integer code, String message, Object data) {
        return new Result(code, message, data);
    }
    public static Result error(Integer code, String message) {
        return new Result(code, message, null);
    }
}
